{% load static %}

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Swift网盘 - 登录</title>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- 自定义CSS -->
    <link rel="stylesheet" type="text/css" href="{% static 'css/Login.css' %}"/>
    <style>
        /* 自定义样式 */
        body {
            background-color: #f8f9fa;
        }
        .login-container {
            max-width: 400px;
            height: 100%;
            margin: 100px auto;
            background-color: #fff;
            padding: 10px;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        .login-container h1 {
            text-align: center;
            margin-bottom: 10px;
            margin-top: 0px;
        }
        .login-container img {
            display: block;
            margin: 0 auto 20px;
            width: 80px;
            border-radius: 50%;
        }
        .login-container .form-label {
            font-weight: bold;
            height: 30px;
            width: 80px;
        }
        .login-container .form-control {
            margin-bottom: 15px;
            border-radius: 5px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            width: 200px;
            height: 25px;
            margin-left: 20px;
        }
        .login-container .btn {
            width: 100%;
            padding: 10px;
            font-size: 16px;
        }
        .btn-primary {
            background-color: #007bff;
            border-color: #007bff;
        }

        .btn-primary:hover {
            background-color: #0056b3;
            border-color: #0056b3;
        }
        .mb-3{
            width: 300px;
            height: 50px;
            display: flex;
        }
        .form{
        width: 300px;
        height: 150px;
        margin: 0 auto;
        margin-bottom: 30px;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <h1>Swift网盘</h1>
        <img src="{% static 'img/admin.jpg' %}" alt="Admin Logo">
        <form method="post" action="/login/" class="form">
            {% csrf_token %}
            <div class="mb-3">
                <label for="username" class="form-label">用户名</label>
                <input type="text" class="form-control" id="username" placeholder="请输入用户名" name="u" required>
            </div>
            <div class="mb-3">
                <label for="password" class="form-label">密码</label>
                <input type="password" class="form-control" id="password" placeholder="密码" name="p" required>
            </div>
            {% if login_error_msg %}
                <div class="alert alert-danger" role="alert">
                    {{ login_error_msg }}
                </div>
            {% endif %}
            <button type="submit" class="btn btn-primary">登录</button>
        </form>
    </div>

    <!-- Bootstrap JS (可选) -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>